	 
					
			
	 


	clear 


				 
	use  "$Replicationdirectory/_Work/TEMP/events_Regression_NonSelectiveRISK"


 

			
			 
		  
   
   			 

			 
 
			
		
		* generate theta (risk of any default)
		
		gen ytm_anydefault= ytm-y_consol_London
		
		* generate theta (1-pi)
		gen ytm_genrisk= ytm-(spread_ytm)-y_consol_London
 		
		
		
		label var ytm_genrisk "Risk `any default'"		
		label var ytm_genrisk "Risk `general default'"		
		label var spread_liquidity "Liquidity"
		label var PERIOD_TREATMENT "News shock"

				
					eststo clear

					
					* Any default risk 
				
 				
  
 									 
						   			
									* Whole sample 											
									eststo 	any_def_neg_wS: reghdfe ytm_anydefault     	 	   PERIOD_TREATMENT		 		ROLL    	 	///
									if HET_EVENT==0		& NEG_NEWS_EVENT==1  	& market!="london"  	, absorb(EVENt_ID_MARKET)   				 cluster(EVENt_ID_MARKET   date   )
										estadd local LiquidityControl="$\checkmark$"
									
									eststo 	any_def_pos_wS: reghdfe ytm_anydefault     	 	   PERIOD_TREATMENT		 		ROLL  		 	///
									if HET_EVENT==0 	& POS_NEWS_EVENT==1	 	& market!="london" , absorb(EVENt_ID_MARKET  )   				 cluster(EVENt_ID_MARKET     date )
										estadd local LiquidityControl="$\checkmark$"
									
									
 									*   Paris data only											
									eststo 	any_def_neg_PS: reghdfe ytm_anydefault     	  	   PERIOD_TREATMENT		 		       	 ROLL	///
									if HET_EVENT==0		& NEG_NEWS_EVENT==1   	& market=="paris"	, absorb(EVENt_ID_MARKET )    	cluster( EVENt_ID_MARKET   date  )
											estadd local LiquidityControl="$\checkmark$"
											estadd local Parisonly="$\checkmark$"									
									
									eststo 	any_def_pos_PS: reghdfe ytm_anydefault     	 	   PERIOD_TREATMENT		 		   		 ROLL	///
									if HET_EVENT==0 	& POS_NEWS_EVENT==1		& market=="paris"	, absorb(EVENt_ID_MARKET)  	 	cluster(EVENt_ID_MARKET     date )
											estadd local LiquidityControl="$\checkmark$"
											estadd local Parisonly="$\checkmark$"
						
						   			
				* General default risk 
 									 
									 											
									eststo 	gen_def_neg: reghdfe ytm_genrisk   	 	   PERIOD_TREATMENT		 		ROLL    	 	///
									if HET_EVENT==0		& NEG_NEWS_EVENT==1  	& market=="london"   	, absorb(EVENt_ID_MARKET)   				 cluster(EVENt_ID_MARKET   date   )
										estadd local LiquidityControl="$\checkmark$"
										
									 
									
									eststo 	gen_def_pos: reghdfe ytm_genrisk     	 	   PERIOD_TREATMENT		 		ROLL  		 	///
									if HET_EVENT==0 	& POS_NEWS_EVENT==1  & market=="london"	, absorb(EVENt_ID_MARKET  )   				 cluster(EVENt_ID_MARKET     date )
										estadd local LiquidityControl="$\checkmark$"
									
									
 									*								
									
									  
					
					
							**** Main results
							
										* RTF 
										esttab     any_def_pos_wS any_def_pos_PS any_def_neg_wS any_def_neg_PS  gen_def_pos gen_def_neg ///
										using "$Replicationdirectory/_Work/Output/Appendices/Tables/Table_B2_AnyGeneralRisk.rtf", drop(  ROLL   _cons  ) replace b(2) se(2) onecell label   compress ///
										stats( LiquidityControl Parisonly  N N_clust      r2_a r2_within, fmt(0  0 0 0 2 2 ) labels("Liquidity control" "Paris data only"  ///
										"\emph{N}(Observations)" "\emph{N} (Events)" "Adjusted \emph{R}\textsuperscript{2}" "Within \emph{R}\textsuperscript{2}"))  ///  
										title ("") modelwidth(6) nogap star( * 0.1 ** 0.05 *** 0.01) 
											
											 
										* LATEX 
										/*
										esttab      any_def_pos_wS any_def_pos_PS any_def_neg_wS any_def_neg_PS  gen_def_pos gen_def_neg ///
										using "$Replicationdirectory/_Work/Output/TABS/theta_generalnews.tex", drop(  ROLL   _cons  ) replace b(2) se(2)    label  compress ///
										stats( LiquidityControl Parisonly  N N_clust      r2_a r2_within, fmt(0  0 0 0 2 2 ) labels("Liquidity control" "Paris data only"  ///
										"\emph{N}(Observations)" "\emph{N} (Events)" "Adjusted \emph{R}\textsuperscript{2}" "Within \emph{R}\textsuperscript{2}"))  ///  
										title ("") modelwidth(6) nogap star( * 0.1 ** 0.05 *** 0.01) 
										*/	
											   
																		
					
			